<template>
  <div>
    <el-descriptions
      class="margin-top"
      title="基本信息"
      :column="2"
      size="small"
      border
      v-if="id != null"
    >
      <el-descriptions-item label="软件编号">
        <template slot="label"><i class="el-icon-s-tools" /> 软件编号</template>
        {{ form.softwareNum }}
      </el-descriptions-item>
      <el-descriptions-item label="软件名称">
        <template slot="label"><i class="el-icon-box" /> 软件名称 </template>
        {{ form.softwareName }}
      </el-descriptions-item>
      <el-descriptions-item label="软件分类">
        <template slot="label"
          ><i class="el-icon-collection" /> 软件分类</template
        >
        {{ form.softwareCategoryName }}
      </el-descriptions-item>
      <el-descriptions-item label="所属公司">
        <template slot="label"
          ><i class="el-icon-collection" /> 软件分类</template
        >
        {{ form.company }}
      </el-descriptions-item>
      <el-descriptions-item label="管理员">
        <template slot="label"><i class="el-icon-user-solid" />管理员</template>
        {{ form.adminName }}
      </el-descriptions-item>
      <el-descriptions-item label="用途">
        <template slot="label"><i class="el-icon-s-tools" /> 用途</template>
        {{ form.purposes }}
      </el-descriptions-item>
      <el-descriptions-item label="使用人">
        <template slot="label"><i class="el-icon-user" />使用人</template>
        {{ form.empName }}
      </el-descriptions-item>
      <el-descriptions-item label="使用部门">
        <template slot="label"><i class="el-icon-s-grid" /> 使用部门</template>
        {{ form.departName }}
      </el-descriptions-item>
      <el-descriptions-item label="软件来源">
        <template slot="label"
          ><i class="el-icon-collection" /> 软件来源</template
        >
        <el-tag v-if="form.source === 1" type="success">购入</el-tag>
        <el-tag v-else-if="form.source === 2" type="success">自建</el-tag>
        <el-tag v-else-if="form.source === 3" type="success">租赁</el-tag>
        <el-tag v-else-if="form.source === 4" type="success">捐赠</el-tag>
        <el-tag v-else-if="form.source === 5" type="success">盘盈</el-tag>
        <el-tag v-else-if="form.source === 6" type="success">其他</el-tag>
        <!-- {{ form.source }} -->
      </el-descriptions-item>
      <el-descriptions-item label="供应商">
        <template slot="label"><i class="el-icon-s-tools" /> 供应商</template>
        {{ form.supplierName }}
      </el-descriptions-item>
      <el-descriptions-item label="购置日期">
        <template slot="label"><i class="el-icon-coin" /> 购置日期</template>
        <el-date-picker
          v-model="form.buyTime"
          type="date"
          :disabled="true"
        />
      </el-descriptions-item>
      <el-descriptions-item label="购置金额">
        <template slot="label"><i class="el-icon-coin" /> 购置金额</template>
        {{ form.amount }}
      </el-descriptions-item>
      <el-descriptions-item label="描述">
        <template slot="label"><i class="el-icon-coin" /> 描述</template>
        {{ form.description }}
      </el-descriptions-item>
    </el-descriptions>
  </div>
</template>

<script>
import { software } from "@/api/software";
export default {
  props: ["id"],
  data() {
    return {
      form: {
        
      },
    };
  },
  created() {
    this.getBasicSoftware();
  },
  methods: {
    getBasicSoftware() {
      software.findBasic(this.id).then((res) => {
        this.form = res.data;
      });
    },
  },
};
</script>

<style scoped></style>
